package day21_447;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

/**
 * @author Edge
 * @create 2021-05-30-22:06
 * @description
 */
public class Solution {
    public int numberOfBoomerangs(int[][] points) {
        if (points.length <= 2){
            return 0;
        }

        HashMap<Integer, List<Double>> map = new HashMap<>();
        int count = 0;
        for (int i = 0; i < points.length - 1; i++) {
            for (int j = i; j < points.length; j++) {
                double v1 = Math.pow((points[i][0] - points[j][0]), 2) + Math.pow((points[i][1] - points[j][1]), 2);
                if (!map.containsKey(i)) {
                    List<Double> list = new ArrayList<>();
                    list.add(v1);
                }else {
                    List<Double> list = map.get(i);
                    list.add(v1);
                    map.put(i, list);
                }
            }
        }


        for (Integer key : map.keySet()) {
            Collections.sort(map.get(key));
            for (Integer v : map.keySet()) {

            }
        }

        return count;
    }

}
